package com.jk.smartelderlycare.entity;

import lombok.Data;
import lombok.ToString;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.math.BigDecimal;

@Data
@ToString
@Document(indexName = "pinyougou")
public class Item {

    @Id
    private Long id;

    @Field(type = FieldType.Text, analyzer = "ik_max_word")
//    @Field(type = FieldType.Text)
    private String title;

    @Field(type = FieldType.Double)
    private BigDecimal price;

    @Field(type = FieldType.Text, index = false)
    private String image;

    @Field(type = FieldType.Long)
    private Long goodsId;

    @Field(type = FieldType.Keyword)
    private String category;

    @Field(value = "brand", type = FieldType.Keyword)
    private String brand;

    @Field(type = FieldType.Keyword)
    private String seller;
}

